package com.enjoyor.soa.traffic.core.efoms.easyrule;

import java.util.List;

import org.easyrules.annotation.Action;
import org.easyrules.annotation.Condition;
import org.easyrules.annotation.Priority;
import org.easyrules.annotation.Rule;

import com.enjoyor.soa.traffic.core.efoms.domain.RepairsRecordInfo;
import com.enjoyor.soa.traffic.core.efoms.enums.EnumDicPublic;

@Rule
public class CancelRecordRule {

	private String code;

	private List list;
	
	private RepairsRecordInfo repairsRecordInfo;

	@Condition // 判断是否符合规则；
	public boolean isCancel() {
		return code.equals(EnumDicPublic.REP_OPER_CHECK.getKey());
	}

	@Action // 命中规则后执行动作
	public void AddPassList() {
		list.add(repairsRecordInfo);
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setList(List list) {
		this.list = list;
	}

	public void setRepairsRecordInfo(RepairsRecordInfo repairsRecordInfo) {
		this.repairsRecordInfo = repairsRecordInfo;
	}

	@Priority // 设置优先级，优先级 0/1/2/3..... 越小优先级越高
	public int getPriority() {
		return 1;
	}


}
